package com.patternbox.eclipse.views;

import com.patternbox.eclipse.model.DesignPatternInstance;

public class AffectedPattern {
	
	private String patternName;
	private String typeAffected;
	private String affectedBy;
	private DesignPatternInstance instance;
	
	public AffectedPattern(String name, String affected, String affectedBy, DesignPatternInstance patternInstance){
		patternName = name;
		typeAffected = affected;
		this.affectedBy = affectedBy;
		instance = patternInstance;
	}
	
	public String getPatternName() {
		return patternName;
	}
	
	public void setPatternName(String patternName) {
		this.patternName = patternName;
	}
	
	public String getTypeAffected() {
		return typeAffected;
	}
	
	public void setTypeAffected(String typeAffected) {
		this.typeAffected = typeAffected;
	}
	
	public String getAffectedBy() {
		return affectedBy;
	}
	
	public void setAffectedBy(String affectedBy) {
		this.affectedBy = affectedBy;
	}

	public DesignPatternInstance getInstance() {
		return instance;
	}

	public void setInstance(DesignPatternInstance instance) {
		this.instance = instance;
	}
	
	public boolean equals(Object o) {
		AffectedPattern p = (AffectedPattern)o;
		return this.instance.getInputFile().getName().equals(p.instance.getInputFile().getName());
	}

}
